package com.cambright.lotusroot
{
	public class Command
	{
		static private function _DISPATCH(command:Command):*
		{
			if(command._dispatched) throw Exception.COMMAND_DISPATCHED;
			
			command._dispatched = true;
			
			var result:* = Application.$CURRENT.$notify(command);
			
			command.dispose();
		
			return result;
		}
		
		private var _dispatched:Boolean = false;
		
		final public function dispatch():*
		{
			return _DISPATCH(this);
		}
		
		public var args:*;
		
		protected function dispose():void {}
	}
}